package com.wengzw.message.core.controller;

import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.wengzw.message.common.annotations.AllowAnonymous;
import com.wengzw.message.common.entity.AuthUser;
import com.wengzw.message.common.entity.ResponseResult;
import com.wengzw.message.common.service.user.UserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import okhttp3.ResponseBody;
import org.slf4j.ILoggerFactory;
import org.springframework.cloud.netflix.ribbon.apache.HttpClientUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.servlet.resource.HttpResource;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @author wengzw
 * @date 2022/5/2 17:31
 */

@RestController
@RequestMapping(UserController.PREFIX)
@Validated
@RequiredArgsConstructor
@Slf4j
public class UserController {

    public static final String PREFIX = "/user";

    private final UserService userService;

    @PostMapping("register")
    public ResponseResult registerUser(@RequestBody AuthUser authUser) {
        userService.register(authUser);
        return ResponseResult.success();
    }

    @GetMapping("download")
    public void download(HttpServletResponse httpServletResponse) {

    }
}
